<h2>DESCRIPTION</h2>

<p><em>v.surf.idw</em> fills a raster matrix with interpolated values
generated from a set of irregularly spaced vector data points using
numerical approximation (weighted averaging) techniques. The
interpolated value of a cell is determined by values of nearby data
points and the distance of the cell from those input points.  In
comparison with other methods, numerical approximation allows
representation of more complex surfaces (particularly those with
anomalous features), restricts the spatial influence of any errors,
and generates the interpolated surface from the data points.

<p>Values to interpolate are read from <b>column</b> option. If this
option is not given than the program uses <i>categories</i> as values
to interpolate or <i>z-coordinates</i> if the input vector map is 3D.

<h2>NOTES</h2>

<p>The amount of memory used by this program is related to the number
of vector points in the current region.  If the vector point map is 
very dense (i.e., contains many data points), the program may
not be able to get all the memory it needs from the
system.  The time required to execute is related to the 
resolution of the current region, after an initial delay 
determined by the time taken to read the input vector points map.

<p>
Note that vector features without category in given <b>layer</b> are
<i>skipped</i>.

<p>If the user has a mask set, then interpolation is only done
for those cells that fall within the mask. The module has two separate
modes of operation for selecting the vector points that are used in the
interpolation:<dl>
<dt>Simple, non-indexed mode (activated by <b>-n</b> flag)</dt>
<dd>When the <b>-n</b> flag is specified, all vector points in the
input vector map are searched through in order to find the
<b>npoints</b> closest points to the centre of each cell in the output
raster map. This mode of operation can be slow in the case of a very
large number of vector points.</dd>
<dt>Default, indexed mode</dt>
<dd>By default (i.e. if <b>-n</b> flag is <i>not</i> specified), prior to
the interpolation, input vector points are indexed according to which
output raster cell they fall into. This means that only cells nearby
the one being interpolated need to be searched to find the
<b>npoints</b> closest input points, and the module can run many times
faster on dense input maps. It should be noted that:
<ul>
<li>Only vector points that lie within the current region are used in
the interpolation. If there are points outside the current region,
this may have an effect on the interpolated value of cells near the
edges of the region, and this effect will be more pronounced the fewer
points there are. If you wish to also include points outside the
region in the interpolation, then either use the <b>-n</b> flag, or
set the region to a larger extent (covering all input points) and use
a mask to limit interpolation to a smaller area.</li>
<li>If more than <b>npoints</b> points fall within a given cell then,
rather than interpolating, these points are aggregated by taking the
mean. This avoids the situation where some vector points can be
discarded and not used in the interpolation, for very dense input
maps. Again, use the <b>-n</b> flag if you wish to use only the
<b>npoints</b> closest points to the cell centre under all
circumstances.</li>
</ul>
</dd>
</dl>

<p>
The <b>power</b> parameter defines an exponential distance weight.
Greater values assign greater influence to values closer to the
point to be interpolated. The interpolation function peaks sharply over
the given data points for 0 &lt; <em>p</em> &lt; 1 and more smoothly for
larger values. The default value for the power parameter is 2.  

<p>
By setting <b>npoints</b>=1, the module can be used to calculate
raster Voronoi diagrams (Thiessen polygons).

<h2>SEE ALSO</h2>

<em>
<a href="g.region.html">g.region</a>,
<a href="r.surf.contour.html">r.surf.contour</a>,
<a href="r.surf.idw.html">r.surf.idw</a>,
<a href="r.surf.gauss.html">r.surf.gauss</a>,
<a href="r.surf.fractal.html">r.surf.fractal</a>,
<a href="r.surf.random.html">r.surf.random</a>,
<a href="v.surf.rst.html">v.surf.rst</a>
</em>

<p>
Overview: <a href="https://grasswiki.osgeo.org/wiki/Interpolation">Interpolation and Resampling</a> in GRASS GIS

<h2>AUTHORS</h2>

Michael Shapiro,  
U.S. Army Construction Engineering 
Research Laboratory
<br>
Improved algorithm (indexes points according to cell and ignores
points outside current region) by Paul Kelly

<!--
<p>
<i>Last changed: $Date$</i>
-->
